package com.mdnote.structure.line_segment_tree;

/**
 * @author Rhythm-2019
 * @version 1.0
 * @date 2020/11/8 23:58
 * @Email rhythm_2019@163.com
 * @Description 线段树实现
 */
public class LineSegmentTree {

    private static final int TREE_NODE_SIZE = 1000;
    private final int[] sourceArr;
    private final int[] treeArr;

    public LineSegmentTree(int[] sourceArr) {
        this.sourceArr = sourceArr;
        this.treeArr = new int[TREE_NODE_SIZE];
    }

    public int query(int start, int end, int nodeIdx, int left, int right) {

        int mid = start + ((end - start) >> 1);
        int nodeLeftIdx = nodeIdx * 2 + 1;
        int nodeRightIdx = nodeIdx * 2 + 2;

        int leftSum = query(start, mid, nodeLeftIdx, left, right);
        
        return 0;
    }

    public void update(int start, int end, int nodeIdx, int arrIdx, int val) {
        int mid = start + ((end - start) >> 1);


    }
}
